package com.etc.test4;


import com.etc.test4.dao.Dao;
import com.etc.test4.dao.DaoException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author MaZheng
 * @since 2020/12/24 - 9:25
 */
public class TestMain2 {

    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext("springContext.xml");

        Dao dao = context.getBean(Dao.class); // 动态代理
//        UserMastDao dao = context.getBean(UserMastDao.class); // cglib代理

        dao.findByUname("aaa");


        try {
            dao.insertuser("aaa", "ddd");
        } catch (DaoException e) {
            e.printStackTrace();
        }


    }
}
